import request from "../../until/request.js"
const state={
	initData:{}
}
const mutations={
	RECEIVEINITDATA(state,initData){
		state.initData=initData
	}
}
const actions={
	async getIndexData({commit}){
		const result=await request("/getIndexData")
		if(result.code==200){
			commit("RECEIVEINITDATA",result.indexData)
		}
	}
}
const getters={
	policyDescList(state){
		return state.initData.policyDescList ? state.initData.policyDescList : []
	},
	kingKongList(state){
		return state.initData.kingKongModule ? state.initData.kingKongModule.kingKongList : []
	},
	categoryModule(state){
		return state.initData.categoryModule ? state.initData.categoryModule : []
	},
}
export default{
	actions,
	mutations,
	state,
	getters
}